package cn.edu.hhtc.stsystem.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

@Entity
@Table(name = "T_RM")
public class PrimaryMaterialEntity {
	
	@Id
	@Column(name = "RM_ID")
	@SequenceGenerator(name = "SEQ_STORE", sequenceName = "SEQ_T_RM", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_STORE")
	private Long pmId;//原材料编号
	
	@Column(name = "RM_NAME")
	private String pmName;//原材料名
	
	@Column(name = "RM_PRICE")
	private Double pmPrice;//单价
	
	@Column(name = "RM_CATEGORY")
	private String pmCategory;//类别
	
	@Column(name = "RM_UNIT")
	private String pmUnit;//计量单位
	
	@Column(name = "RM_STAPLE")
	private String pmStaple;//主/副食
	
	@Column(name = "RM_ORIGIN")
	private String pmOrigin;//产地
	
	@Column(name = "QS_ID")
	private Long pmSuId;//供应商编号
	
	private String supplierName;

	public PrimaryMaterialEntity() {
		super();
	}

	public PrimaryMaterialEntity(Long pmId, String pmName, double pmPrice,
			String pmCategory, String pmUnit, String pmStaple, String pmOrigin,
			Long pmSuId) {
		super();
		this.pmId = pmId;
		this.pmName = pmName;
		this.pmPrice = pmPrice;
		this.pmCategory = pmCategory;
		this.pmUnit = pmUnit;
		this.pmStaple = pmStaple;
		this.pmOrigin = pmOrigin;
		this.pmSuId = pmSuId;
	}
	
	public PrimaryMaterialEntity(String pmName, double pmPrice,
			String pmCategory, String pmUnit, String pmStaple, String pmOrigin) {
		this.pmName = pmName;
		this.pmPrice = pmPrice;
		this.pmCategory = pmCategory;
		this.pmUnit = pmUnit;
		this.pmStaple = pmStaple;
		this.pmOrigin = pmOrigin;
	}
	
	public PrimaryMaterialEntity(PrimaryMaterialEntity entity, String supplierName) {
		this.pmId = entity.pmId;
		this.pmName = entity.pmName;
		this.pmPrice = entity.pmPrice;
		this.pmCategory = entity.pmCategory;
		this.pmUnit = entity.pmUnit;
		this.pmStaple = entity.pmStaple;
		this.pmOrigin = entity.pmOrigin;
		this.pmSuId = entity.pmSuId;
		this.supplierName=supplierName;
	}

	public Long getPmId() {
		return pmId;
	}

	public void setPmId(Long pmId) {
		this.pmId = pmId;
	}

	public String getPmName() {
		return pmName;
	}

	public void setPmName(String pmName) {
		this.pmName = pmName;
	}

	public Double getPmPrice() {
		return pmPrice;
	}

	public void setPmPrice(Double pmPrice) {
		this.pmPrice = pmPrice;
	}

	public String getPmCategory() {
		return pmCategory;
	}

	public void setPmCategory(String pmCategory) {
		this.pmCategory = pmCategory;
	}

	public String getPmUnit() {
		return pmUnit;
	}

	public void setPmUnit(String pmUnit) {
		this.pmUnit = pmUnit;
	}

	public String getPmStaple() {
		return pmStaple;
	}

	public void setPmStaple(String pmStaple) {
		this.pmStaple = pmStaple;
	}

	public String getPmOrigin() {
		return pmOrigin;
	}

	public void setPmOrigin(String pmOrigin) {
		this.pmOrigin = pmOrigin;
	}

	public Long getPmSuId() {
		return pmSuId;
	}

	public void setPmSuId(Long pmSuId) {
		this.pmSuId = pmSuId;
	}

	@Transient
	public String getSupplierName() {
		return supplierName;
	}

	public void setSupplierName(String supplierName) {
		this.supplierName = supplierName;
	}
	
}
